package com.cadre.system.service.impl;

import com.alibaba.fastjson.JSON;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.stream.Collectors;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cadre.common.utils.R;
import com.cadre.common.utils.SecurityUtils;
import com.cadre.common.utils.oldutil.ConcurrentUtil;
import com.cadre.common.utils.oldutil.PageUtils;
import com.cadre.common.utils.oldutil.Query;
import com.cadre.system.domain.officer.*;
import com.cadre.system.mapper.DicStaticMapper;
import com.cadre.system.mapper.StatisConditionMapper;
import com.cadre.system.mapper.StatismenuMapper;
import com.cadre.system.service.StatismenuService;
import org.apache.commons.text.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("statismenuService")
public class StatismenuServiceImpl extends ServiceImpl<StatismenuMapper, StatismenuEntity> implements StatismenuService {
    @Autowired
    private DicStaticMapper dicStaticMapper;
    @Autowired
    private StatisConditionMapper statisConditionMapper;
    private String sql_setting1 = " A0179='省部级正职' ";
    private String sql_setting2 = " A0179='省部级副职' ";
    private String sql_setting3 = " A0179='厅局级正职' ";
    private String sql_setting4 = " A0179='厅局级副职' ";
    private String sql_setting5 = " A0179='县处级正职' ";
    private String sql_setting6 = " A0179='县处级副职' ";
    private String sql_setting7 = " A0179='乡科级正职' ";
    private String sql_setting8 = " A0179='乡科级副职' ";
    private String sql_setting9 = " A0179='办事员' ";
    private String sql_setting10 = " SUBSTR( a04tquanrizhi.a0460, 1, 1 )= 0 ";
    private String sql_setting11 = " SUBSTR( a04tquanrizhi.a0460, 1, 1 )= 1 ";
    private String sql_setting12 = " SUBSTR( a04tquanrizhi.a0460, 1, 1 )= 2 ";
    private String sql_setting13 = " SUBSTR( a04tquanrizhi.a0460, 1, 1 )= 3 ";
    private String sql_setting14 = " (SUBSTR( a04tquanrizhi.a0460, 1, 1 ) not in(0,1,2,3) or a04tquanrizhi.a0460 is null) ";
    private String sql_setting15 = " TRUNC(months_between(sysdate, A0106)/12) >= 0 and TRUNC(months_between(sysdate, A0106)/12) < 31 ";
    private String sql_setting16 = " TRUNC(months_between(sysdate, A0106)/12) >= 31 and TRUNC(months_between(sysdate, A0106)/12) < 36 ";
    private String sql_setting17 = " TRUNC(months_between(sysdate, A0106)/12) >= 36 and TRUNC(months_between(sysdate, A0106)/12) < 41 ";
    private String sql_setting18 = " TRUNC(months_between(sysdate, A0106)/12) >= 41 and TRUNC(months_between(sysdate, A0106)/12) < 46 ";
    private String sql_setting19 = " TRUNC(months_between(sysdate, A0106)/12) >= 46 and TRUNC(months_between(sysdate, A0106)/12) < 51 ";
    private String sql_setting20 = " TRUNC(months_between(sysdate, A0106)/12) >= 51 and TRUNC(months_between(sysdate, A0106)/12) < 56 ";
    private String sql_setting21 = " TRUNC(months_between(sysdate, A0106)/12) >= 56 and TRUNC(months_between(sysdate, A0106)/12) < 60 ";
    private String sql_setting22 = " TRUNC(months_between(sysdate, A0106)/12) >= 60  ";
    private String sql_setting23 = " a0105='女'";
    private String sql_setting24 = " a0130 != '汉族'";
    private String sql_setting25 = " regexp_like(a0184A,'^[^0-9]+$')";
    private String sql_setting26 = " a01.flowid in (SELECT DISTINCT PERSONID FROM A16 t RIGHT JOIN DIC_ZB18 ON DIC_ZB18.NAME = a1602 WHERE ( DIC_ZB18.NAME = '优秀' and A1601 = ( SELECT extract( year FROM SYSDATE )-1  FROM dual ) and regexp_like(A1601,'(^[+-]?\\d{0,}\\.?\\d{0,}$)') ) )";
    private String sql_setting27 = " a01.flowid in (SELECT DISTINCT PERSONID FROM A16 t RIGHT JOIN DIC_ZB18 ON DIC_ZB18.NAME = a1602 WHERE ( DIC_ZB18.NAME = '称职' and A1601 = ( SELECT extract( year FROM SYSDATE )-1  FROM dual ) and regexp_like(A1601,'(^[+-]?\\d{0,}\\.?\\d{0,}$)')) )";
    private String sql_setting28 = " a01.flowid in (SELECT DISTINCT PERSONID FROM A16 t RIGHT JOIN DIC_ZB18 ON DIC_ZB18.NAME = a1602 WHERE ( DIC_ZB18.NAME = '基本称职' and A1601 = ( SELECT extract( year FROM SYSDATE )-1  FROM dual ) and regexp_like(A1601,'(^[+-]?\\d{0,}\\.?\\d{0,}$)')) )";
    private String sql_setting29 = " a01.flowid in (SELECT DISTINCT PERSONID FROM A16 t RIGHT JOIN DIC_ZB18 ON DIC_ZB18.NAME = a1602 WHERE ( DIC_ZB18.NAME = '不称职' and A1601 = ( SELECT extract( year FROM SYSDATE )-1  FROM dual ) and regexp_like(A1601,'(^[+-]?\\d{0,}\\.?\\d{0,}$)')) )";
    private String sql_setting30 = " a01.flowid in (SELECT DISTINCT PERSONID FROM A16 t RIGHT JOIN DIC_ZB18 ON DIC_ZB18.NAME = a1602 WHERE ( DIC_ZB18.NAME = '不定等次' and A1601 = ( SELECT extract( year FROM SYSDATE )-1  FROM dual ) and regexp_like(A1601,'(^[+-]?\\d{0,}\\.?\\d{0,}$)')) )";
    private String sql_setting31 = " TRUNC(months_between(sysdate, a0142)/12) < 2 ";
    private String sql_setting32 = " TRUNC(months_between(sysdate, a0142)/12) >= 2 and TRUNC(months_between(sysdate, a0142)/12) < 3  ";
    private String sql_setting33 = " TRUNC(months_between(sysdate, a0142)/12) >= 3 and TRUNC(months_between(sysdate, a0142)/12) < 4  ";
    private String sql_setting34 = " TRUNC(months_between(sysdate, a0142)/12) >= 4 and TRUNC(months_between(sysdate, a0142)/12) < 5  ";
    private String sql_setting35 = " TRUNC(months_between(sysdate, a0142)/12) >= 5 and TRUNC(months_between(sysdate, a0142)/12) < 6  ";
    private String sql_setting36 = " TRUNC(months_between(sysdate, a0142)/12) >= 6 and TRUNC(months_between(sysdate, a0142)/12) < 7  ";
    private String sql_setting37 = " TRUNC(months_between(sysdate, a0142)/12) >= 7 and TRUNC(months_between(sysdate, a0142)/12) < 8  ";
    private String sql_setting38 = " TRUNC(months_between(sysdate, a0142)/12) >= 8 and TRUNC(months_between(sysdate, a0142)/12) < 12  ";
    private String sql_setting39 = " TRUNC(months_between(sysdate, a0142)/12) >= 12 and TRUNC(months_between(sysdate, a0142)/12) < 15  ";
    private String sql_setting40 = " TRUNC(months_between(sysdate, a0142)/12) >= 15 ";
    private String sql_setting41 = " TRUNC(months_between(sysdate, A0185)/12) < 2 ";
    private String sql_setting42 = " TRUNC(months_between(sysdate, A0185)/12) >= 2 and TRUNC(months_between(sysdate, A0185)/12) < 3  ";
    private String sql_setting43 = " TRUNC(months_between(sysdate, A0185)/12) >= 3 and TRUNC(months_between(sysdate, A0185)/12) < 4  ";
    private String sql_setting44 = " TRUNC(months_between(sysdate, A0185)/12) >= 4 and TRUNC(months_between(sysdate, A0185)/12) < 5  ";
    private String sql_setting45 = " TRUNC(months_between(sysdate, A0185)/12) >= 5 and TRUNC(months_between(sysdate, A0185)/12) < 6  ";
    private String sql_setting46 = " TRUNC(months_between(sysdate, A0185)/12) >= 6 and TRUNC(months_between(sysdate, A0185)/12) < 7  ";
    private String sql_setting47 = " TRUNC(months_between(sysdate, A0185)/12) >= 7 and TRUNC(months_between(sysdate, A0185)/12) < 8  ";
    private String sql_setting48 = " TRUNC(months_between(sysdate, A0185)/12) >= 8 and TRUNC(months_between(sysdate, A0185)/12) < 12  ";
    private String sql_setting49 = " TRUNC(months_between(sysdate, A0185)/12) >= 12 and TRUNC(months_between(sysdate, A0185)/12) < 15  ";
    private String sql_setting50 = " TRUNC(months_between(sysdate, A0185)/12) >= 15 ";
    private String sql_setting51 = " SUBSTR( a04tzuigao.a0460, 1, 1 )= 0 ";
    private String sql_setting52 = " SUBSTR( a04tzuigao.a0460, 1, 1 )= 1";
    private String sql_setting53 = " SUBSTR( a04tzuigao.a0460, 1, 1 )= 2 ";
    private String sql_setting54 = " SUBSTR( a04tzuigao.a0460, 1, 1 )= 3 ";
    private String sql_setting55 = " (SUBSTR( a04tzuigao.a0460, 1, 1 ) not in(0,1,2,3) or a04tzuigao.a0460 is null) ";
    private String sql_setting60 = " regexp_like(A0184A,'^[0-9\\.]+$')";
    private String sql_setting61 = " A0184A like '%预备党员%' ";
    private String sql_setting62 = " A0184A like '%共青团员%' ";
    private String sql_setting63 = " A0184A like '%民革%' ";
    private String sql_setting64 = " A0184A like '%民盟%' ";
    private String sql_setting65 = " A0184A like '%民建%' ";
    private String sql_setting66 = " A0184A like '%民进%' ";
    private String sql_setting67 = " A0184A like '%农工党%' ";
    private String sql_setting68 = " A0184A like '%致公党%' ";
    private String sql_setting69 = " A0184A like '%九三学社%' ";
    private String sql_setting70 = " A0184A like '%台盟%' ";
    private String sql_setting71 = " A0184A like '%无党派%' ";
    private String sql_setting72 = " A0184A like '%群众%' ";
    private String sql_setting73 = " a0177a LIKE '%省直部门正职领导职务%' ";
    private String sql_setting74 = " a0177a LIKE '%省直部门副职领导职务%' ";
    private String sql_setting75 = " a0177a LIKE '%党政正职%' ";
    private String sql_setting76 = " a0177a LIKE '%市级党委正职%' ";
    private String sql_setting77 = " a0177a LIKE '%市级政府正职%' ";
    private String sql_setting78 = " a0177a LIKE '%市级党政正职%' ";
    private String sql_setting79 = " a0177a LIKE '%县级党政正职%' ";
    private String sql_setting80 = " a0177a LIKE '%县级党政副职%' ";
    private String sql_setting81 = " a0177a LIKE '%乡镇（街道）党政正职%' ";
    private String sql_setting82 = " a0177a LIKE '%省直事业单位正职%' ";
    private String sql_setting83 = " a0177a LIKE '%省直事业单位副职%' ";
    private String sql_setting84 = " a01.flowid in (select PERSONID from A12 where A1201 = '退休') ";
    private String sql_setting85 = " a01.flowid in (select PERSONID from A12 where A1201 = '调出') ";
    private String sql_setting86 = " a01.flowid in (select PERSONID from A12 where A1201 = '死亡') ";
    private String sql_setting87 = " a01.flowid in (select PERSONID from A12 where A1201 = '辞职') ";
    private String sql_setting88 = " a01.flowid in (select PERSONID from A12 where A1201 = '其他')  ";
    private String sql_start = "sum(case when ";
    private String sql_end = " then 1 else 0 end )";
    private String sql_where = " where a0201 IN (1) and ";
    private String[] big_list = new String[]{"干部职级", "全日制学历", "年龄信息", "女少非", "考核等次", "任现职级年限", "任现职务层次年限", "最高学历", "入党时间", "参加工作时间", "政治面貌", "工作经历", "退出情况", "合计"};
    @Autowired
    private StatismenuMapper statismenuMapper;
    private static final Map<Object, String> map = new HashMap();
    private static final Map<String, String> aliasMap = new HashMap();

    public StatismenuServiceImpl() {
    }

    public PageUtils queryPage(Map<String, Object> params) {
        Page<StatismenuEntity> page = this.baseMapper.selectPage((new Query(params)).getPage(), new LambdaQueryWrapper<>());
        return new PageUtils(page);
    }

    public List<AssemData> queryAverage(Map<String, Object> map) {
        String query = (String)map.get("condition");
        Object obj = map.get("unitCode");
        if (obj != null && !"".equals(obj)) {
            String[] unitCode = obj.toString().split(",");
            if (unitCode.length != 1 || !"".equals(unitCode[0])) {
                map.put("unitCode", unitCode);
            }
        }

        List<StatisCondition> sclist = JSON.parseArray(query, StatisCondition.class);
        String subquery = this.buildSubQuery(sclist);
        map.put("subquery", subquery);
        return this.getData(map);
    }

    public List<AssemData> getData(Map<String, Object> map) {
        Long userId = SecurityUtils.getUserId();
        map.put("userId", userId);
        List<Chart> listAgeAve = ((StatismenuMapper)this.baseMapper).queryAverage(map);
        List<Chart> listAgeGroup = ((StatismenuMapper)this.baseMapper).queryAgeGroup(map);
        List<Chart> listQZZXueli = ((StatismenuMapper)this.baseMapper).queryQZZXueli(map);
        List<Chart> listSexGroup = ((StatismenuMapper)this.baseMapper).querySexGroup(map);
        List<Chart> listZGXueli = ((StatismenuMapper)this.baseMapper).queryZGXueli(map);
        List<Chart> listZhiwuCengci = ((StatismenuMapper)this.baseMapper).queryZhiwuCengci(map);
        List<Chart> listZZMMGroup = ((StatismenuMapper)this.baseMapper).queryZZMMGroup(map);
        List<Chart> listMinzu = ((StatismenuMapper)this.baseMapper).queryMinzu(map);
        List<Integer> list = new ArrayList();
        list.add(listAgeAve.size());
        list.add(listAgeGroup.size());
        list.add(listQZZXueli.size());
        list.add(listSexGroup.size());
        list.add(listZGXueli.size());
        list.add(listZhiwuCengci.size());
        list.add(listZZMMGroup.size());
        list.add(listMinzu.size());
        int length = (Integer)Collections.max(list);
        List<AssemData> assemDataList = new ArrayList();

        for(int i = 0; i < length; ++i) {
            AssemData data = new AssemData();
            data.setAvgAgeName(i >= listAgeAve.size() ? null : ((Chart)listAgeAve.get(i)).getName());
            data.setAvgAgeValue(i >= listAgeAve.size() ? null : ((Chart)listAgeAve.get(i)).getValue());
            data.setAgeGroupName(i >= listAgeGroup.size() ? null : ((Chart)listAgeGroup.get(i)).getName());
            data.setAgeGroupValue(i >= listAgeGroup.size() ? null : ((Chart)listAgeGroup.get(i)).getValue());
            data.setAlias(i >= listAgeGroup.size() ? null : (String)aliasMap.get(((Chart)listAgeGroup.get(i)).getName()));
            data.setMinzuName(i >= listMinzu.size() ? null : ((Chart)listMinzu.get(i)).getName());
            data.setMinzuValue(i >= listMinzu.size() ? null : ((Chart)listMinzu.get(i)).getValue());
            data.setQrzxueliName(i >= listQZZXueli.size() ? null : ((Chart)listQZZXueli.get(i)).getName());
            data.setQrzxueliValue(i >= listQZZXueli.size() ? null : ((Chart)listQZZXueli.get(i)).getValue());
            data.setSexGroupName(i >= listSexGroup.size() ? null : ((Chart)listSexGroup.get(i)).getName());
            data.setSexGroupValue(i >= listSexGroup.size() ? null : ((Chart)listSexGroup.get(i)).getValue());
            data.setZgxueliName(i >= listZGXueli.size() ? null : ((Chart)listZGXueli.get(i)).getName());
            data.setZgxueliValue(i >= listZGXueli.size() ? null : ((Chart)listZGXueli.get(i)).getValue());
            data.setZwccName(i >= listZhiwuCengci.size() ? null : ((Chart)listZhiwuCengci.get(i)).getName());
            data.setZwccValue(i >= listZhiwuCengci.size() ? null : ((Chart)listZhiwuCengci.get(i)).getValue());
            data.setZzmianmaoName(i >= listZZMMGroup.size() ? null : ((Chart)listZZMMGroup.get(i)).getName());
            data.setZzmianmaoValue(i >= listZZMMGroup.size() ? null : ((Chart)listZZMMGroup.get(i)).getValue());
            assemDataList.add(data);
        }

        return assemDataList;
    }

    private String buildSubQuery(List<StatisCondition> list) {
        if (list != null && list.size() != 0) {
            StringBuilder sb = new StringBuilder();
            Map<Integer, List<StatisCondition>> map = (Map)list.stream().collect(Collectors.groupingBy((f) -> {
                return f.getType();
            }));
            int[] index = new int[]{0};
            map.keySet().forEach((t) -> {
                List<StatisCondition> item = (List)map.get(t);
                String sql = this.embledData(item);
                int var10002;
                if (index[0] == 0) {
                    sb.append(sql);
                    var10002 = index[0]++;
                } else {
                    sb.append(" union ").append(sql);
                    var10002 = index[0]++;
                }
            });
            return sb.toString();
        } else {
            return "";
        }
    }

    public String embledData(List<StatisCondition> list) {
        StringBuilder sql = new StringBuilder();
        sql.append("select distinct A01.flowid from A01 ");
        List<String> tableNames = (List)list.stream().map((f) -> {
            return f.getTableName();
        }).distinct().collect(Collectors.toList());

        for(int i = 0; i < tableNames.size(); ++i) {
            if (!((String)tableNames.get(i)).equals("A01")) {
                sql.append(" join ").append((String)tableNames.get(i)).append(" on ").append(" A01.flowid = ").append((String)tableNames.get(i)).append(".personid");
            }
        }

        sql.append(" where 1=1 ");
        list.forEach((t) -> {
            String condition = this.buildSqlCondition(t);
            sql.append(" and ").append(condition);
        });
        return sql.toString();
    }

    private String buildSqlCondition(StatisCondition sc) {
        int key = sc.getModel();
        String sql = (String)map.get(key);
        String finalstring = this.replaceParam(sql, sc);
        return finalstring;
    }

    private String replaceParam(String sql, StatisCondition sc) {
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM");
            Date now = new Date();
            int tempAge = Integer.parseInt(sc.getValue());
            if (tempAge < 200 && sc.getFiledName().equals("A0106")) {
                Calendar cal = Calendar.getInstance();
                cal.setTime(now);
                cal.add(1, 0 - tempAge);
                Date d1 = new Date(cal.getTimeInMillis());
                sc.setValue(sdf.format(d1));
                if (sc.getOperator().contains("&gt;")) {
                    sc.setOperator(sc.getOperator().replace("&gt;", "&lt;"));
                } else if (sc.getOperator().contains("&lt;")) {
                    sc.setOperator(sc.getOperator().replace("&lt;", "&gt;"));
                }
            }
        } catch (Exception var8) {
        }

        return sql.replace("field", sc.getTableName() + "." + sc.getFiledName()).replace("operator", StringEscapeUtils.unescapeXml(sc.getOperator())).replace("value", sc.getValue());
    }

    public List<DicStatic> queryByFId(String fcode) {
        LambdaQueryWrapper<DicStatic> wrapper = new LambdaQueryWrapper();
        wrapper.eq(DicStatic::getFcode, fcode);
        return this.dicStaticMapper.selectList(wrapper);
    }

    @Transactional
    public void updateStatisCondition(List<StatisCondition> list) {
        Long userId = SecurityUtils.getUserId();
        String name = ((StatisCondition)list.get(0)).getConditionName();
        LambdaQueryWrapper<StatisCondition> wrapper = new LambdaQueryWrapper();
        wrapper.eq(StatisCondition::getConditionName, name).eq(StatisCondition::getUserId, userId);
        this.statisConditionMapper.delete(wrapper);
        Iterator var5 = list.iterator();

        while(var5.hasNext()) {
            StatisCondition entity = (StatisCondition)var5.next();
            entity.setUserId(userId);
            this.statisConditionMapper.insert(entity);
        }

    }

    public void deleteStatisCondition(String conditionName) {
        Long userId = SecurityUtils.getUserId();
        LambdaQueryWrapper<StatisCondition> wrapper = new LambdaQueryWrapper();
        wrapper.eq(StatisCondition::getConditionName, conditionName).eq(StatisCondition::getUserId, userId);
        this.statisConditionMapper.delete(wrapper);
    }

    public List<StatisCondition> getCondition(String conditionName) {
        Long userId = SecurityUtils.getUserId();
        LambdaQueryWrapper<StatisCondition> wrapper = new LambdaQueryWrapper();
        wrapper.eq(StatisCondition::getConditionName, conditionName).
                eq(StatisCondition::getUserId, userId).orderByAsc(StatisCondition::getType);
        List<StatisCondition> list = this.statisConditionMapper.selectList(wrapper);
        return list;
    }

    public List<Object> getConditionName() {
        Long userId = SecurityUtils.getUserId();
        QueryWrapper<StatisCondition> wrapper = new QueryWrapper();
        wrapper.select("DISTINCT CONDITION_NAME,TYPE").eq("USERID", userId).orderByAsc("CONDITION_NAME nulls FIRST");
        List<Object> list = this.statisConditionMapper.selectObjs(wrapper);
        return list;
    }

    public List<A01> inverseQueryForA01(Map<String, Object> map) {
        Map<String, Object> sqlMap = this.buildSqlMap(map);

        try {
            Object obj = map.get("unitCode");
            if (obj != null && !"".equals(obj)) {
                String[] unitCode = obj.toString().split(",");
                if (unitCode.length != 1 || !"".equals(unitCode[0])) {
                    sqlMap.put("unitCode", unitCode);
                }
            }
        } catch (Exception var5) {
        }

        return ((StatismenuMapper)this.baseMapper).inverseQueryForA01(sqlMap);
    }

    public List<A01> inverseQueryForA22(Map<String, Object> map) {
        Map<String, Object> sqlMap = this.buildSqlMap(map);

        try {
            Object obj = map.get("unitCode");
            if (obj != null && !"".equals(obj)) {
                String[] unitCode = obj.toString().split(",");
                if (unitCode.length != 1 || !"".equals(unitCode[0])) {
                    sqlMap.put("unitCode", unitCode);
                }
            }
        } catch (Exception var5) {
        }

        return ((StatismenuMapper)this.baseMapper).inverseQueryForA22(sqlMap);
    }

    public List<A01> inverseQueryForA04Zg(Map<String, Object> map) {
        Map<String, Object> sqlMap = this.buildSqlMap(map);

        try {
            Object obj = map.get("unitCode");
            if (obj != null && !"".equals(obj)) {
                String[] unitCode = obj.toString().split(",");
                if (unitCode.length != 1 || !"".equals(unitCode[0])) {
                    sqlMap.put("unitCode", unitCode);
                }
            }
        } catch (Exception var5) {
        }

        return ((StatismenuMapper)this.baseMapper).inverseQueryForA04Zg(sqlMap);
    }

    public List<A01> inverseQueryForA04Qrz(Map<String, Object> map) {
        Map<String, Object> sqlMap = this.buildSqlMap(map);

        try {
            Object obj = map.get("unitCode");
            if (obj != null && !"".equals(obj)) {
                String[] unitCode = obj.toString().split(",");
                if (unitCode.length != 1 || !"".equals(unitCode[0])) {
                    sqlMap.put("unitCode", unitCode);
                }
            }
        } catch (Exception var5) {
        }

        return ((StatismenuMapper)this.baseMapper).inverseQueryForA04Qrz(sqlMap);
    }

    public R listFromSetting(Map<String, Object> map) {
        List<Map<String, Object>> row_setting_list = new ArrayList();

        try {
            this.sql_where = " where a0201 IN (1) ";
            this.sql_where = this.sql_where + " and";
            this.initMap(map);
            this.initCol(map);
            String[] row_data_list = map.get("row_data").toString().split(",");
            String[] unitCode_list = map.get("unitCode").toString().split(",");
            String unitCode = "";

            int i;
            for(i = 0; i < unitCode_list.length; ++i) {
                unitCode = unitCode + "'" + unitCode_list[i] + "',";
            }

            if (!unitCode_list[0].equals("")) {
                map.put("unitCodes", unitCode.substring(0, unitCode.length() - 1));
            }

            if (row_data_list.length > 0) {
                for(i = 0; i < row_data_list.length; ++i) {
                    Map<String, Object> map1 = new HashMap();

                    try {
                        StatismenuServiceImpl.map.remove("row_rd_date_before");
                        if (map.get("row_rd_date_before").toString() != null && !"".equals(map.get("row_rd_date_before").toString())) {
                            StatismenuServiceImpl.map.put("row_rd_date_before", map.get("row_rd_date_before").toString());
                        }
                    } catch (Exception var19) {
                    }

                    try {
                        StatismenuServiceImpl.map.remove("row_rd_date_begin");
                        if (map.get("row_rd_date_begin").toString() != null && !"".equals(map.get("row_rd_date_begin").toString())) {
                            StatismenuServiceImpl.map.put("row_rd_date_begin", map.get("row_rd_date_begin").toString());
                        }
                    } catch (Exception var18) {
                    }

                    try {
                        if (map.get("row_rd_date_end").toString() != null && !"".equals(map.get("row_rd_date_end").toString())) {
                            StatismenuServiceImpl.map.put("row_rd_date_end", map.get("row_rd_date_end").toString());
                        }
                    } catch (Exception var17) {
                    }

                    try {
                        StatismenuServiceImpl.map.remove("row_cj_date_before");
                        if (map.get("row_cj_date_before").toString() != null && !"".equals(map.get("row_cj_date_before").toString())) {
                            StatismenuServiceImpl.map.put("row_cj_date_before", map.get("row_cj_date_before").toString());
                        }
                    } catch (Exception var16) {
                    }

                    try {
                        StatismenuServiceImpl.map.remove("row_cj_date_begin");
                        if (map.get("row_cj_date_begin").toString() != null && !"".equals(map.get("row_cj_date_begin").toString())) {
                            StatismenuServiceImpl.map.put("row_cj_date_begin", map.get("row_cj_date_begin").toString());
                        }
                    } catch (Exception var15) {
                    }

                    try {
                        StatismenuServiceImpl.map.remove("row_cj_date_end");
                        if (map.get("row_cj_date_end").toString() != null && !"".equals(map.get("row_cj_date_end").toString())) {
                            StatismenuServiceImpl.map.put("row_cj_date_end", map.get("row_cj_date_end").toString());
                        }
                    } catch (Exception var14) {
                    }

                    this.initRow(row_data_list[i], map1);
                    System.out.println("row_setting的值----" + map1.get("row_setting"));
                    System.out.println("bigtype的值----" + map1.get("bigtype"));
                    System.out.println("smalltype的值----" + map1.get("smalltype"));
                    row_setting_list.add(map1);
                }
            }

            map.put("row_setting_list", row_setting_list);
        } catch (Exception var20) {
        }

        String endTime;
        try {
            endTime = String.valueOf(map.get("staticsStartTime"));
            if (endTime != null && !"".equals(endTime) && !"null".equals(endTime.toLowerCase())) {
                map.put("staticsStartTime", endTime);
            }
        } catch (Exception var13) {
        }

        try {
            endTime = String.valueOf(map.get("staticsEndTime"));
            if (endTime != null && !"".equals(endTime) && !"null".equals(endTime.toLowerCase())) {
                map.put("staticsEndTime", endTime);
            }
        } catch (Exception var12) {
        }

        List<StatisticsResult> list = new ArrayList();
        List<Future<List<StatisticsResult>>> listFuture = new ArrayList(0);
        long startTime = System.currentTimeMillis();
        System.out.println("row_setting_list.size()"+row_setting_list.size());
        ExecutorService executorService = Executors.newFixedThreadPool(10);

        int m1;
        for(m1 = 0; m1 < row_setting_list.size(); ++m1) {
            try {
                Map<String, Object> combineResultMap = new HashMap();
                combineResultMap.putAll((Map)row_setting_list.get(m1));
                combineResultMap.putAll(map);
                listFuture.add(ConcurrentUtil.doJob(executorService, () -> {
                    return this.getStatisticsResultSingle(combineResultMap);
                }));
            } catch (Exception var11) {
                Exception ex = var11;
                ex.printStackTrace();
            }
        }

        for(m1 = 0; m1 < row_setting_list.size(); ++m1) {
            try {
                list.addAll((Collection)ConcurrentUtil.futureGet((Future)listFuture.get(m1)));
            } catch (Exception var10) {
            }
        }

        long endTime1 = System.currentTimeMillis();
        System.out.println("程序运行时间： " + (endTime1 - startTime) + "ms");
        return R.ok().put("data", list);
    }

    private List<StatisticsResult> getStatisticsResultSingle(Map<String, Object> combineResultMap) {
        return this.statismenuMapper.resultFromSettingSingle(combineResultMap);
    }

    public Map<String, Object> initMap(Map<String, Object> map) {
        map.put("col_1", 0);
        map.put("col_2", 0);
        map.put("col_3", 0);
        map.put("col_4", 0);
        map.put("col_5", 0);
        map.put("col_6", 0);
        map.put("col_7", 0);
        map.put("col_8", 0);
        map.put("col_9", 0);
        map.put("col_10", 0);
        map.put("col_11", 0);
        map.put("col_12", 0);
        map.put("col_13", 0);
        map.put("col_14", 0);
        map.put("col_15", 0);
        map.put("col_16", 0);
        map.put("col_17", 0);
        map.put("col_18", 0);
        map.put("col_19", 0);
        map.put("col_20", 0);
        map.put("col_21", 0);
        map.put("col_22", 0);
        map.put("col_23", 0);
        map.put("col_24", 0);
        map.put("col_25", 0);
        map.put("col_26", 0);
        map.put("col_27", 0);
        map.put("col_28", 0);
        map.put("col_29", 0);
        map.put("col_30", 0);
        map.put("col_31", 0);
        map.put("col_32", 0);
        map.put("col_33", 0);
        map.put("col_34", 0);
        map.put("col_35", 0);
        map.put("col_36", 0);
        map.put("col_37", 0);
        map.put("col_38", 0);
        map.put("col_39", 0);
        map.put("col_40", 0);
        map.put("col_41", 0);
        map.put("col_42", 0);
        map.put("col_43", 0);
        map.put("col_44", 0);
        map.put("col_45", 0);
        map.put("col_46", 0);
        map.put("col_47", 0);
        map.put("col_48", 0);
        map.put("col_49", 0);
        map.put("col_50", 0);
        map.put("col_51", 0);
        map.put("col_52", 0);
        map.put("col_53", 0);
        map.put("col_54", 0);
        map.put("col_55", 0);
        map.put("col_56", 0);
        map.put("col_57", 0);
        map.put("col_58", 0);
        map.put("col_59", 0);
        map.put("col_60", 0);
        map.put("col_61", 0);
        map.put("col_62", 0);
        map.put("col_63", 0);
        map.put("col_64", 0);
        map.put("col_65", 0);
        map.put("col_66", 0);
        map.put("col_67", 0);
        map.put("col_68", 0);
        map.put("col_69", 0);
        map.put("col_70", 0);
        map.put("col_71", 0);
        map.put("col_72", 0);
        map.put("col_73", 0);
        map.put("col_74", 0);
        map.put("col_75", 0);
        map.put("col_76", 0);
        map.put("col_77", 0);
        map.put("col_78", 0);
        map.put("col_79", 0);
        map.put("col_80", 0);
        map.put("col_81", 0);
        map.put("col_82", 0);
        map.put("col_83", 0);
        map.put("col_84", 0);
        map.put("col_85", 0);
        map.put("col_86", 0);
        map.put("col_87", 0);
        map.put("col_88", 0);
        map.put("counts", 0);
        return map;
    }

    private Map<String, Object> buildSqlMap(Map<String, Object> map) {
        Long userId = SecurityUtils.getUserId();
        map.put("userId", userId);
        String query = (String)map.get("condition");
        List<StatisCondition> sclist = JSON.parseArray(query, StatisCondition.class);
        String subquery = this.buildSubQuery(sclist);
        map.put("subquery", subquery);
        return map;
    }

    public List<DicStatic> queryAllDic() {
        LambdaQueryWrapper<DicStatic> wrapper = new LambdaQueryWrapper();
        return this.dicStaticMapper.selectList(wrapper);
    }

    public Map<String, Object> initCol(Map<String, Object> map) {
        String[] col_data_list = map.get("col_data").toString().split(",");
        if (col_data_list.length > 0) {
            for(int i = 0; i < col_data_list.length; ++i) {
                if (col_data_list[i].equals("1")) {
                    map.put("col_1", this.sql_start + this.sql_setting1 + this.sql_end);
                } else if (col_data_list[i].equals("2")) {
                    map.put("col_2", this.sql_start + this.sql_setting2 + this.sql_end);
                } else if (col_data_list[i].equals("3")) {
                    map.put("col_3", this.sql_start + this.sql_setting3 + this.sql_end);
                } else if (col_data_list[i].equals("4")) {
                    map.put("col_4", this.sql_start + this.sql_setting4 + this.sql_end);
                } else if (col_data_list[i].equals("5")) {
                    map.put("col_5", this.sql_start + this.sql_setting5 + this.sql_end);
                } else if (col_data_list[i].equals("6")) {
                    map.put("col_6", this.sql_start + this.sql_setting6 + this.sql_end);
                } else if (col_data_list[i].equals("7")) {
                    map.put("col_7", this.sql_start + this.sql_setting7 + this.sql_end);
                } else if (col_data_list[i].equals("8")) {
                    map.put("col_8", this.sql_start + this.sql_setting8 + this.sql_end);
                } else if (col_data_list[i].equals("9")) {
                    map.put("col_9", this.sql_start + this.sql_setting9 + this.sql_end);
                } else if (col_data_list[i].equals("10")) {
                    map.put("col_10", this.sql_start + this.sql_setting10 + this.sql_end);
                } else if (col_data_list[i].equals("11")) {
                    map.put("col_11", this.sql_start + this.sql_setting11 + this.sql_end);
                } else if (col_data_list[i].equals("12")) {
                    map.put("col_12", this.sql_start + this.sql_setting12 + this.sql_end);
                } else if (col_data_list[i].equals("13")) {
                    map.put("col_13", this.sql_start + this.sql_setting13 + this.sql_end);
                } else if (col_data_list[i].equals("14")) {
                    map.put("col_14", this.sql_start + this.sql_setting14 + this.sql_end);
                } else if (col_data_list[i].equals("15")) {
                    map.put("col_15", this.sql_start + this.sql_setting15 + this.sql_end);
                } else if (col_data_list[i].equals("16")) {
                    map.put("col_16", this.sql_start + this.sql_setting16 + this.sql_end);
                } else if (col_data_list[i].equals("17")) {
                    map.put("col_17", this.sql_start + this.sql_setting17 + this.sql_end);
                } else if (col_data_list[i].equals("18")) {
                    map.put("col_18", this.sql_start + this.sql_setting18 + this.sql_end);
                } else if (col_data_list[i].equals("19")) {
                    map.put("col_19", this.sql_start + this.sql_setting19 + this.sql_end);
                } else if (col_data_list[i].equals("20")) {
                    map.put("col_20", this.sql_start + this.sql_setting20 + this.sql_end);
                } else if (col_data_list[i].equals("21")) {
                    map.put("col_21", this.sql_start + this.sql_setting21 + this.sql_end);
                } else if (col_data_list[i].equals("22")) {
                    map.put("col_22", this.sql_start + this.sql_setting22 + this.sql_end);
                } else if (col_data_list[i].equals("23")) {
                    map.put("col_23", this.sql_start + this.sql_setting23 + this.sql_end);
                } else if (col_data_list[i].equals("24")) {
                    map.put("col_24", this.sql_start + this.sql_setting24 + this.sql_end);
                } else if (col_data_list[i].equals("25")) {
                    map.put("col_25", this.sql_start + this.sql_setting25 + this.sql_end);
                } else if (col_data_list[i].equals("26")) {
                    map.put("col_26", this.sql_start + this.sql_setting26 + this.sql_end);
                } else if (col_data_list[i].equals("27")) {
                    map.put("col_27", this.sql_start + this.sql_setting27 + this.sql_end);
                } else if (col_data_list[i].equals("28")) {
                    map.put("col_28", this.sql_start + this.sql_setting28 + this.sql_end);
                } else if (col_data_list[i].equals("29")) {
                    map.put("col_29", this.sql_start + this.sql_setting29 + this.sql_end);
                } else if (col_data_list[i].equals("30")) {
                    map.put("col_30", this.sql_start + this.sql_setting30 + this.sql_end);
                } else if (col_data_list[i].equals("31")) {
                    map.put("col_31", this.sql_start + this.sql_setting31 + this.sql_end);
                } else if (col_data_list[i].equals("32")) {
                    map.put("col_32", this.sql_start + this.sql_setting32 + this.sql_end);
                } else if (col_data_list[i].equals("33")) {
                    map.put("col_33", this.sql_start + this.sql_setting33 + this.sql_end);
                } else if (col_data_list[i].equals("34")) {
                    map.put("col_34", this.sql_start + this.sql_setting34 + this.sql_end);
                } else if (col_data_list[i].equals("35")) {
                    map.put("col_35", this.sql_start + this.sql_setting35 + this.sql_end);
                } else if (col_data_list[i].equals("36")) {
                    map.put("col_36", this.sql_start + this.sql_setting36 + this.sql_end);
                } else if (col_data_list[i].equals("37")) {
                    map.put("col_37", this.sql_start + this.sql_setting37 + this.sql_end);
                } else if (col_data_list[i].equals("38")) {
                    map.put("col_38", this.sql_start + this.sql_setting38 + this.sql_end);
                } else if (col_data_list[i].equals("39")) {
                    map.put("col_39", this.sql_start + this.sql_setting39 + this.sql_end);
                } else if (col_data_list[i].equals("40")) {
                    map.put("col_40", this.sql_start + this.sql_setting40 + this.sql_end);
                } else if (col_data_list[i].equals("41")) {
                    map.put("col_41", this.sql_start + this.sql_setting41 + this.sql_end);
                } else if (col_data_list[i].equals("42")) {
                    map.put("col_42", this.sql_start + this.sql_setting42 + this.sql_end);
                } else if (col_data_list[i].equals("43")) {
                    map.put("col_43", this.sql_start + this.sql_setting43 + this.sql_end);
                } else if (col_data_list[i].equals("44")) {
                    map.put("col_44", this.sql_start + this.sql_setting44 + this.sql_end);
                } else if (col_data_list[i].equals("45")) {
                    map.put("col_45", this.sql_start + this.sql_setting45 + this.sql_end);
                } else if (col_data_list[i].equals("46")) {
                    map.put("col_46", this.sql_start + this.sql_setting46 + this.sql_end);
                } else if (col_data_list[i].equals("47")) {
                    map.put("col_47", this.sql_start + this.sql_setting47 + this.sql_end);
                } else if (col_data_list[i].equals("48")) {
                    map.put("col_48", this.sql_start + this.sql_setting48 + this.sql_end);
                } else if (col_data_list[i].equals("49")) {
                    map.put("col_49", this.sql_start + this.sql_setting49 + this.sql_end);
                } else if (col_data_list[i].equals("50")) {
                    map.put("col_50", this.sql_start + this.sql_setting50 + this.sql_end);
                } else if (col_data_list[i].equals("51")) {
                    map.put("col_51", this.sql_start + this.sql_setting51 + this.sql_end);
                } else if (col_data_list[i].equals("52")) {
                    map.put("col_52", this.sql_start + this.sql_setting52 + this.sql_end);
                } else if (col_data_list[i].equals("53")) {
                    map.put("col_53", this.sql_start + this.sql_setting53 + this.sql_end);
                } else if (col_data_list[i].equals("54")) {
                    map.put("col_54", this.sql_start + this.sql_setting54 + this.sql_end);
                } else if (col_data_list[i].equals("55")) {
                    map.put("col_55", this.sql_start + this.sql_setting55 + this.sql_end);
                } else if (col_data_list[i].equals("56")) {
                    if (!map.get("col_rd_date_before").toString().equals("")) {
                        map.put("col_56", "sum(case when a0184 <= (select to_date('" + map.get("col_rd_date_before").toString() + "','yyyy.MM') from dual) then 1 else 0 end )");
                    }
                } else if (col_data_list[i].equals("57")) {
                    if (!map.get("col_rd_date_begin").toString().equals("") || !map.get("col_rd_date_end").toString().equals("")) {
                        map.put("col_57", "sum(case when a0184 <= (select to_date('" + map.get("col_rd_date_end").toString() + "','yyyy.MM') from dual) and a0184 >= (select to_date('" + map.get("col_rd_date_begin").toString() + "','yyyy.MM') from dual) then 1 else 0 end )");
                    }
                } else if (col_data_list[i].equals("58")) {
                    if (!map.get("col_cj_date_before").toString().equals("")) {
                        map.put("col_58", "sum(case when A0138 <= (select to_date('" + map.get("col_cj_date_before").toString() + "','yyyy.MM') from dual) then 1 else 0 end )");
                    }
                } else if (col_data_list[i].equals("59")) {
                    if (!map.get("col_cj_date_begin").toString().equals("") || !map.get("col_cj_date_end").toString().equals("")) {
                        map.put("col_59", "sum(case when A0138 <= (select to_date('" + map.get("col_cj_date_end").toString() + "','yyyy.MM') from dual) and A0138 >= (select to_date('" + map.get("col_cj_date_begin").toString() + "','yyyy.MM') from dual) then 1 else 0 end )");
                    }
                } else if (col_data_list[i].equals("60")) {
                    map.put("col_60", this.sql_start + this.sql_setting60 + this.sql_end);
                } else if (col_data_list[i].equals("61")) {
                    map.put("col_61", this.sql_start + this.sql_setting61 + this.sql_end);
                } else if (col_data_list[i].equals("62")) {
                    map.put("col_62", this.sql_start + this.sql_setting62 + this.sql_end);
                } else if (col_data_list[i].equals("63")) {
                    map.put("col_63", this.sql_start + this.sql_setting63 + this.sql_end);
                } else if (col_data_list[i].equals("64")) {
                    map.put("col_64", this.sql_start + this.sql_setting64 + this.sql_end);
                } else if (col_data_list[i].equals("65")) {
                    map.put("col_65", this.sql_start + this.sql_setting65 + this.sql_end);
                } else if (col_data_list[i].equals("66")) {
                    map.put("col_66", this.sql_start + this.sql_setting66 + this.sql_end);
                } else if (col_data_list[i].equals("67")) {
                    map.put("col_67", this.sql_start + this.sql_setting67 + this.sql_end);
                } else if (col_data_list[i].equals("68")) {
                    map.put("col_68", this.sql_start + this.sql_setting68 + this.sql_end);
                } else if (col_data_list[i].equals("69")) {
                    map.put("col_69", this.sql_start + this.sql_setting69 + this.sql_end);
                } else if (col_data_list[i].equals("70")) {
                    map.put("col_70", this.sql_start + this.sql_setting70 + this.sql_end);
                } else if (col_data_list[i].equals("71")) {
                    map.put("col_71", this.sql_start + this.sql_setting71 + this.sql_end);
                } else if (col_data_list[i].equals("72")) {
                    map.put("col_72", this.sql_start + this.sql_setting72 + this.sql_end);
                } else if (col_data_list[i].equals("73")) {
                    map.put("col_73", this.sql_start + this.sql_setting73 + this.sql_end);
                } else if (col_data_list[i].equals("74")) {
                    map.put("col_74", this.sql_start + this.sql_setting74 + this.sql_end);
                } else if (col_data_list[i].equals("75")) {
                    map.put("col_75", this.sql_start + this.sql_setting75 + this.sql_end);
                } else if (col_data_list[i].equals("76")) {
                    map.put("col_76", this.sql_start + this.sql_setting76 + this.sql_end);
                } else if (col_data_list[i].equals("77")) {
                    map.put("col_77", this.sql_start + this.sql_setting77 + this.sql_end);
                } else if (col_data_list[i].equals("78")) {
                    map.put("col_78", this.sql_start + this.sql_setting78 + this.sql_end);
                } else if (col_data_list[i].equals("79")) {
                    map.put("col_79", this.sql_start + this.sql_setting79 + this.sql_end);
                } else if (col_data_list[i].equals("80")) {
                    map.put("col_80", this.sql_start + this.sql_setting80 + this.sql_end);
                } else if (col_data_list[i].equals("81")) {
                    map.put("col_81", this.sql_start + this.sql_setting81 + this.sql_end);
                } else if (col_data_list[i].equals("82")) {
                    map.put("col_82", this.sql_start + this.sql_setting82 + this.sql_end);
                } else if (col_data_list[i].equals("83")) {
                    map.put("col_83", this.sql_start + this.sql_setting83 + this.sql_end);
                } else if (col_data_list[i].equals("84")) {
                    map.put("col_84", this.sql_start + this.sql_setting84 + this.sql_end.replace("1,2", "0"));
                } else if (col_data_list[i].equals("85")) {
                    map.put("col_85", this.sql_start + this.sql_setting85 + this.sql_end.replace("1,2", "0"));
                } else if (col_data_list[i].equals("86")) {
                    map.put("col_86", this.sql_start + this.sql_setting86 + this.sql_end.replace("1,2", "0"));
                } else if (col_data_list[i].equals("87")) {
                    map.put("col_87", this.sql_start + this.sql_setting87 + this.sql_end.replace("1,2", "0"));
                } else if (col_data_list[i].equals("88")) {
                    map.put("col_88", this.sql_start + this.sql_setting88 + this.sql_end.replace("1,2", "0"));
                } else {
                    map.put("counts", "sum(case when 1=1 then 1 else 0 end )");
                }
            }
        }

        return map;
    }

    public Map<String, Object> initRow(String row_data_item, Map<String, Object> map1) {
        if (row_data_item.equals("1")) {
            map1.put("row_setting", this.sql_where + this.sql_setting1);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'省部级正职'");
            map1.put("typenum", "'1'");
        } else if (row_data_item.equals("2")) {
            map1.put("row_setting", this.sql_where + this.sql_setting2);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'省部级副职'");
            map1.put("typenum", "'2'");
        } else if (row_data_item.equals("3")) {
            map1.put("row_setting", this.sql_where + this.sql_setting3);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'厅局级正职'");
            map1.put("typenum", "'3'");
        } else if (row_data_item.equals("4")) {
            map1.put("row_setting", this.sql_where + this.sql_setting4);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'厅局级副职'");
            map1.put("typenum", "'4'");
        } else if (row_data_item.equals("5")) {
            map1.put("row_setting", this.sql_where + this.sql_setting5);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'县处级正职'");
            map1.put("typenum", "'5'");
        } else if (row_data_item.equals("6")) {
            map1.put("row_setting", this.sql_where + this.sql_setting6);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'县处级副职'");
            map1.put("typenum", "'6'");
        } else if (row_data_item.equals("7")) {
            map1.put("row_setting", this.sql_where + this.sql_setting7);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'乡科级正职'");
            map1.put("typenum", "'7'");
        } else if (row_data_item.equals("8")) {
            map1.put("row_setting", this.sql_where + this.sql_setting8);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'乡科级副职'");
            map1.put("typenum", "'8'");
        } else if (row_data_item.equals("9")) {
            map1.put("row_setting", this.sql_where + this.sql_setting9);
            map1.put("bigtype", "'干部职级'");
            map1.put("smalltype", "'办事员'");
            map1.put("typenum", "'9'");
        } else if (row_data_item.equals("10")) {
            map1.put("row_setting", this.sql_where + this.sql_setting10);
            map1.put("bigtype", "'全日制学历'");
            map1.put("smalltype", "'博士'");
            map1.put("typenum", "'10'");
        } else if (row_data_item.equals("11")) {
            map1.put("row_setting", this.sql_where + this.sql_setting11);
            map1.put("bigtype", "'全日制学历'");
            map1.put("smalltype", "'研究生'");
            map1.put("typenum", "'11'");
        } else if (row_data_item.equals("12")) {
            map1.put("row_setting", this.sql_where + this.sql_setting12);
            map1.put("bigtype", "'全日制学历'");
            map1.put("smalltype", "'大学本科'");
            map1.put("typenum", "'12'");
        } else if (row_data_item.equals("13")) {
            map1.put("row_setting", this.sql_where + this.sql_setting13);
            map1.put("bigtype", "'全日制学历'");
            map1.put("smalltype", "'大学专科'");
            map1.put("typenum", "'13'");
        } else if (row_data_item.equals("14")) {
            map1.put("row_setting", this.sql_where + this.sql_setting14);
            map1.put("bigtype", "'全日制学历'");
            map1.put("smalltype", "'中专及以下'");
            map1.put("typenum", "'14'");
        } else if (row_data_item.equals("15")) {
            map1.put("row_setting", this.sql_where + this.sql_setting15);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'30岁及以下'");
            map1.put("typenum", "'15'");
        } else if (row_data_item.equals("16")) {
            map1.put("row_setting", this.sql_where + this.sql_setting16);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'31-35岁'");
            map1.put("typenum", "'16'");
        } else if (row_data_item.equals("17")) {
            map1.put("row_setting", this.sql_where + this.sql_setting17);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'36-40岁'");
            map1.put("typenum", "'17'");
        } else if (row_data_item.equals("18")) {
            map1.put("row_setting", this.sql_where + this.sql_setting18);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'41-45岁'");
            map1.put("typenum", "'18'");
        } else if (row_data_item.equals("19")) {
            map1.put("row_setting", this.sql_where + this.sql_setting19);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'46-50岁'");
            map1.put("typenum", "'19'");
        } else if (row_data_item.equals("20")) {
            map1.put("row_setting", this.sql_where + this.sql_setting20);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'51-55岁'");
            map1.put("typenum", "'20'");
        } else if (row_data_item.equals("21")) {
            map1.put("row_setting", this.sql_where + this.sql_setting21);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'56-59岁'");
            map1.put("typenum", "'21'");
        } else if (row_data_item.equals("22")) {
            map1.put("row_setting", this.sql_where + this.sql_setting22);
            map1.put("bigtype", "'年龄信息'");
            map1.put("smalltype", "'60岁及以上'");
            map1.put("typenum", "'22'");
        } else if (row_data_item.equals("23")) {
            map1.put("row_setting", this.sql_where + this.sql_setting23);
            map1.put("bigtype", "'女少非'");
            map1.put("smalltype", "'少数民族'");
            map1.put("typenum", "'23'");
        } else if (row_data_item.equals("24")) {
            map1.put("row_setting", this.sql_where + this.sql_setting24);
            map1.put("bigtype", "'女少非'");
            map1.put("smalltype", "'少数民族'");
            map1.put("typenum", "'24'");
        } else if (row_data_item.equals("25")) {
            map1.put("row_setting", this.sql_where + this.sql_setting25);
            map1.put("bigtype", "'女少非'");
            map1.put("smalltype", "'非中共'");
            map1.put("typenum", "'25'");
        } else if (row_data_item.equals("26")) {
            map1.put("row_setting", this.sql_where + this.sql_setting26);
            map1.put("bigtype", "'考核等次'");
            map1.put("smalltype", "'优秀'");
            map1.put("typenum", "'26'");
        } else if (row_data_item.equals("27")) {
            map1.put("row_setting", this.sql_where + this.sql_setting27);
            map1.put("bigtype", "'考核等次'");
            map1.put("smalltype", "'称职'");
            map1.put("typenum", "'27'");
        } else if (row_data_item.equals("28")) {
            map1.put("row_setting", this.sql_where + this.sql_setting28);
            map1.put("bigtype", "'考核等次'");
            map1.put("smalltype", "'基本称职'");
            map1.put("typenum", "'28'");
        } else if (row_data_item.equals("29")) {
            map1.put("row_setting", this.sql_where + this.sql_setting29);
            map1.put("bigtype", "'考核等次'");
            map1.put("smalltype", "'不称职'");
            map1.put("typenum", "'29'");
        } else if (row_data_item.equals("30")) {
            map1.put("row_setting", this.sql_where + this.sql_setting30);
            map1.put("bigtype", "'考核等次'");
            map1.put("smalltype", "'不定等次'");
            map1.put("typenum", "'30'");
        } else if (row_data_item.equals("31")) {
            map1.put("row_setting", this.sql_where + this.sql_setting31);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'不满2年'");
            map1.put("typenum", "'31'");
        } else if (row_data_item.equals("32")) {
            map1.put("row_setting", this.sql_where + this.sql_setting32);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'2年至不满3年'");
            map1.put("typenum", "'32'");
        } else if (row_data_item.equals("33")) {
            map1.put("row_setting", this.sql_where + this.sql_setting33);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'3年至不满4年'");
            map1.put("typenum", "'33'");
        } else if (row_data_item.equals("34")) {
            map1.put("row_setting", this.sql_where + this.sql_setting34);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'4年至不满5年'");
            map1.put("typenum", "'34'");
        } else if (row_data_item.equals("35")) {
            map1.put("row_setting", this.sql_where + this.sql_setting35);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'5年至不满6年'");
            map1.put("typenum", "'35'");
        } else if (row_data_item.equals("36")) {
            map1.put("row_setting", this.sql_where + this.sql_setting36);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'6年至不满7年'");
            map1.put("typenum", "'36'");
        } else if (row_data_item.equals("37")) {
            map1.put("row_setting", this.sql_where + this.sql_setting37);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'7年至不满8年'");
            map1.put("typenum", "'37'");
        } else if (row_data_item.equals("38")) {
            map1.put("row_setting", this.sql_where + this.sql_setting38);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'8年至不满12年'");
            map1.put("typenum", "'38'");
        } else if (row_data_item.equals("39")) {
            map1.put("row_setting", this.sql_where + this.sql_setting39);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'12年至不满15年'");
            map1.put("typenum", "'39'");
        } else if (row_data_item.equals("40")) {
            map1.put("row_setting", this.sql_where + this.sql_setting40);
            map1.put("bigtype", "'任现职级年限'");
            map1.put("smalltype", "'15年及以上'");
            map1.put("typenum", "'40'");
        } else if (row_data_item.equals("41")) {
            map1.put("row_setting", this.sql_where + this.sql_setting41);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'不满2年'");
            map1.put("typenum", "'41'");
        } else if (row_data_item.equals("42")) {
            map1.put("row_setting", this.sql_where + this.sql_setting42);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'2年至不满3年'");
            map1.put("typenum", "'42'");
        } else if (row_data_item.equals("43")) {
            map1.put("row_setting", this.sql_where + this.sql_setting43);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'3年至不满4年'");
            map1.put("typenum", "'43'");
        } else if (row_data_item.equals("44")) {
            map1.put("row_setting", this.sql_where + this.sql_setting44);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'4年至不满5年'");
            map1.put("typenum", "'44'");
        } else if (row_data_item.equals("45")) {
            map1.put("row_setting", this.sql_where + this.sql_setting45);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'5年至不满6年'");
            map1.put("typenum", "'45'");
        } else if (row_data_item.equals("46")) {
            map1.put("row_setting", this.sql_where + this.sql_setting46);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'6年至不满7年'");
            map1.put("typenum", "'46'");
        } else if (row_data_item.equals("47")) {
            map1.put("row_setting", this.sql_where + this.sql_setting47);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'7年至不满8年'");
            map1.put("typenum", "'47'");
        } else if (row_data_item.equals("48")) {
            map1.put("row_setting", this.sql_where + this.sql_setting48);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'8年至不满12年'");
            map1.put("typenum", "'48'");
        } else if (row_data_item.equals("49")) {
            map1.put("row_setting", this.sql_where + this.sql_setting49);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'12年至不满15年'");
            map1.put("typenum", "'49'");
        } else if (row_data_item.equals("50")) {
            map1.put("row_setting", this.sql_where + this.sql_setting50);
            map1.put("bigtype", "'任现职务层次年限'");
            map1.put("smalltype", "'15年及以上'");
            map1.put("typenum", "'50'");
        } else if (row_data_item.equals("51")) {
            map1.put("row_setting", this.sql_where + this.sql_setting51);
            map1.put("bigtype", "'最高学历'");
            map1.put("smalltype", "'博士'");
            map1.put("typenum", "'51'");
        } else if (row_data_item.equals("52")) {
            map1.put("row_setting", this.sql_where + this.sql_setting52);
            map1.put("bigtype", "'最高学历'");
            map1.put("smalltype", "'研究生'");
            map1.put("typenum", "'52'");
        } else if (row_data_item.equals("53")) {
            map1.put("row_setting", this.sql_where + this.sql_setting53);
            map1.put("bigtype", "'最高学历'");
            map1.put("smalltype", "'大学本科'");
            map1.put("typenum", "'53'");
        } else if (row_data_item.equals("54")) {
            map1.put("row_setting", this.sql_where + this.sql_setting54);
            map1.put("bigtype", "'最高学历'");
            map1.put("smalltype", "'大学专科'");
            map1.put("typenum", "'54'");
        } else if (row_data_item.equals("55")) {
            map1.put("row_setting", this.sql_where + this.sql_setting55);
            map1.put("bigtype", "'最高学历'");
            map1.put("smalltype", "'中专及以下'");
            map1.put("typenum", "'55'");
        } else if (row_data_item.equals("56")) {
            if (!((String)map.get("row_rd_date_before")).toString().equals("")) {
                map1.put("row_setting", " where a0201 in (1) and a0184 <= (select  to_date('" + ((String)map.get("row_rd_date_before")).toString() + "','yyyy.MM') from dual) ");
                map1.put("bigtype", "'入党时间'");
                map1.put("smalltype", "'" + ((String)map.get("row_rd_date_before")).toString() + "以前'");
                map1.put("typenum", "'56'");
            } else {
                map1.put("row_setting", "where 1=1");
                map1.put("bigtype", "'入党时间'");
                map1.put("smalltype", "'入党全时间段'");
                map1.put("typenum", "'56'");
            }
        } else if (row_data_item.equals("57")) {
            if (((String)map.get("row_rd_date_begin")).toString().equals("") && ((String)map.get("row_rd_date_end")).toString().equals("")) {
                map1.put("row_setting", "where 1=1");
                map1.put("bigtype", "'入党时间'");
                map1.put("smalltype", "'入党全时间段'");
                map1.put("typenum", "'57'");
            } else {
                map1.put("row_setting", " where a0201 in (1) and a0184 <= (select  to_date('" + ((String)map.get("row_rd_date_end")).toString() + "','yyyy.MM') from dual) and a0184 >= (select to_date('" + ((String)map.get("row_rd_date_begin")).toString() + "','yyyy.MM') from dual) ");
                map1.put("bigtype", "'入党时间'");
                map1.put("smalltype", "'" + ((String)map.get("row_rd_date_begin")).toString() + "至" + ((String)map.get("row_rd_date_end")).toString() + "'");
                map1.put("typenum", "'57'");
            }
        } else if (row_data_item.equals("58")) {
            if (!((String)map.get("row_cj_date_before")).toString().equals("")) {
                map1.put("row_setting", " where a0201 in (1) and A0138 <= (select  to_date('" + ((String)map.get("row_cj_date_before")).toString() + "','yyyy.MM') from dual) ");
                map1.put("bigtype", "'参加工作时间'");
                map1.put("smalltype", "'" + ((String)map.get("row_cj_date_before")).toString() + "以前'");
                map1.put("typenum", "'58'");
            } else {
                map1.put("row_setting", "where 1=1");
                map1.put("bigtype", "'参加工作时间'");
                map1.put("smalltype", "'参加工作全时间段'");
                map1.put("typenum", "'58'");
            }
        } else if (row_data_item.equals("59")) {
            if (((String)map.get("row_cj_date_begin")).toString().equals("") && ((String)map.get("row_cj_date_end")).toString().equals("")) {
                map1.put("row_setting", "where 1=1");
                map1.put("bigtype", "'参加工作时间'");
                map1.put("smalltype", "'参加工作全时间段'");
                map1.put("typenum", "'59'");
            } else {
                map1.put("row_setting", " where a0201 in (1) and A0138 <= (select  to_date('" + ((String)map.get("row_cj_date_end")).toString() + "','yyyy.MM') from dual) and A0138 >= (select to_date('" + ((String)map.get("row_cj_date_begin")).toString() + "','yyyy.MM') from dual) ");
                map1.put("bigtype", "'参加工作时间'");
                map1.put("smalltype", "'" + ((String)map.get("row_cj_date_begin")).toString() + "至" + ((String)map.get("row_cj_date_end")).toString() + "'");
                map1.put("typenum", "'59'");
            }
        } else if (row_data_item.equals("60")) {
            map1.put("row_setting", this.sql_where + this.sql_setting60);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'中共党员'");
            map1.put("typenum", "'60'");
        } else if (row_data_item.equals("61")) {
            map1.put("row_setting", this.sql_where + this.sql_setting61);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'预备党员'");
            map1.put("typenum", "'61'");
        } else if (row_data_item.equals("62")) {
            map1.put("row_setting", this.sql_where + this.sql_setting62);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'共青团员'");
            map1.put("typenum", "'62'");
        } else if (row_data_item.equals("63")) {
            map1.put("row_setting", this.sql_where + this.sql_setting63);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'民革'");
            map1.put("typenum", "'63'");
        } else if (row_data_item.equals("64")) {
            map1.put("row_setting", this.sql_where + this.sql_setting64);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'民盟'");
            map1.put("typenum", "'64'");
        } else if (row_data_item.equals("65")) {
            map1.put("row_setting", this.sql_where + this.sql_setting65);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'民建'");
            map1.put("typenum", "'65'");
        } else if (row_data_item.equals("66")) {
            map1.put("row_setting", this.sql_where + this.sql_setting66);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'民进'");
            map1.put("typenum", "'66'");
        } else if (row_data_item.equals("67")) {
            map1.put("row_setting", this.sql_where + this.sql_setting67);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'农工党'");
            map1.put("typenum", "'67'");
        } else if (row_data_item.equals("68")) {
            map1.put("row_setting", this.sql_where + this.sql_setting68);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'致公党'");
            map1.put("typenum", "'68'");
        } else if (row_data_item.equals("69")) {
            map1.put("row_setting", this.sql_where + this.sql_setting69);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'九三学社'");
            map1.put("typenum", "'69'");
        } else if (row_data_item.equals("70")) {
            map1.put("row_setting", this.sql_where + this.sql_setting70);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'台盟'");
            map1.put("typenum", "'70'");
        } else if (row_data_item.equals("71")) {
            map1.put("row_setting", this.sql_where + this.sql_setting71);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'无党派'");
            map1.put("typenum", "'71'");
        } else if (row_data_item.equals("72")) {
            map1.put("row_setting", this.sql_where + this.sql_setting72);
            map1.put("bigtype", "'政治面貌'");
            map1.put("smalltype", "'群众'");
            map1.put("typenum", "'72'");
        } else if (row_data_item.equals("73")) {
            map1.put("row_setting", this.sql_where + this.sql_setting73);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'省直部门正职领导职务'");
            map1.put("typenum", "'73'");
        } else if (row_data_item.equals("74")) {
            map1.put("row_setting", this.sql_where + this.sql_setting74);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'省直部门副职领导职务'");
            map1.put("typenum", "'74'");
        } else if (row_data_item.equals("75")) {
            map1.put("row_setting", this.sql_where + this.sql_setting75);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'党政正职'");
            map1.put("typenum", "'75'");
        } else if (row_data_item.equals("76")) {
            map1.put("row_setting", this.sql_where + this.sql_setting76);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'市级党委正职'");
            map1.put("typenum", "'76'");
        } else if (row_data_item.equals("77")) {
            map1.put("row_setting", this.sql_where + this.sql_setting77);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'市级政府正职'");
            map1.put("typenum", "'77'");
        } else if (row_data_item.equals("78")) {
            map1.put("row_setting", this.sql_where + this.sql_setting78);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'市级党政正职'");
            map1.put("typenum", "'78'");
        } else if (row_data_item.equals("79")) {
            map1.put("row_setting", this.sql_where + this.sql_setting79);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'县级党政正职'");
            map1.put("typenum", "'79'");
        } else if (row_data_item.equals("80")) {
            map1.put("row_setting", this.sql_where + this.sql_setting80);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'县级党政副职'");
            map1.put("typenum", "'80'");
        } else if (row_data_item.equals("81")) {
            map1.put("row_setting", this.sql_where + this.sql_setting81);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'乡镇（街道）党政正职'");
            map1.put("typenum", "'81'");
        } else if (row_data_item.equals("82")) {
            map1.put("row_setting", this.sql_where + this.sql_setting82);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'省直事业单位正职'");
            map1.put("typenum", "'82'");
        } else if (row_data_item.equals("83")) {
            map1.put("row_setting", this.sql_where + this.sql_setting83);
            map1.put("bigtype", "'工作经历'");
            map1.put("smalltype", "'省直事业单位副职'");
            map1.put("typenum", "'83'");
        } else if (row_data_item.equals("84")) {
            map1.put("row_setting", this.sql_where.replace("1,2", "0") + this.sql_setting84);
            map1.put("bigtype", "'退出情况'");
            map1.put("smalltype", "'退休");
            map1.put("typenum", "'84'");
        } else if (row_data_item.equals("85")) {
            map1.put("row_setting", this.sql_where.replace("1,2", "0") + this.sql_setting85);
            map1.put("bigtype", "'退出情况'");
            map1.put("smalltype", "'调出'");
            map1.put("typenum", "'85'");
        } else if (row_data_item.equals("86")) {
            map1.put("row_setting", this.sql_where.replace("1,2", "0") + this.sql_setting86);
            map1.put("bigtype", "'退出情况'");
            map1.put("smalltype", "'死亡'");
            map1.put("typenum", "'86'");
        } else if (row_data_item.equals("87")) {
            map1.put("row_setting", this.sql_where.replace("1,2", "0") + this.sql_setting87);
            map1.put("bigtype", "'退出情况'");
            map1.put("smalltype", "'辞职'");
            map1.put("typenum", "'87'");
        } else if (row_data_item.equals("88")) {
            map1.put("row_setting", this.sql_where.replace("1,2", "0") + this.sql_setting88);
            map1.put("bigtype", "'退出情况'");
            map1.put("smalltype", "'其他'");
            map1.put("typenum", "'88'");
        } else {
            map1.put("row_setting", " where a0201 IN (1)  ");
            map1.put("bigtype", "'合计'");
            map1.put("smalltype", "'总数'");
            map1.put("typenum", "'0'");
        }

        return map1;
    }

    public R listFromQurey(Map<String, Object> map) {
        String currentPage = (String)map.get("pageNum");
        String pageSize = (String)map.get("pageSize");
        map.put("page", currentPage);
        map.put("limit", pageSize);
        this.initCol(map);
        this.initRow(map.get("row_data").toString(), map);
        String col_qurey = "";

        try {
            col_qurey = map.get("col_" + map.get("col_data")).toString();
        } catch (Exception var19) {
        }

        String row_qurey = map.get("row_setting").toString();

        try {
            System.out.println("列条件------" + col_qurey.substring(14, col_qurey.length() - this.sql_end.length()));
        } catch (Exception var18) {
            System.out.println("列条件------空");
        }

        try {
            System.out.println("行条件------" + row_qurey.substring(this.sql_where.length()));
        } catch (Exception var17) {
            System.out.println("行条件------空");
        }

        try {
            map.put("col", col_qurey.substring(14, col_qurey.length() - this.sql_end.length()));
        } catch (Exception var16) {
            map.put("col", " a0201 IN (1) ");
        }

        try {
            map.put("row", row_qurey.substring(this.sql_where.length()));
        } catch (Exception var15) {
            map.put("row", " a0201 IN (1) ");
        }

        String[] unitCode_list = map.get("unitParam").toString().split(",");
        String unitCode = "";
        String qureywhere = " and a0201 IN (1) ";

        String endTime;
        try {
            endTime = String.valueOf(map.get("staticsStartTime"));
            if (endTime != null && !"".equals(endTime) && !"null".equals(endTime)) {
                this.sql_where = this.sql_where + " and a01.a0180 >= to_date(" + endTime + ",'yyyy.MM')";
            }
        } catch (Exception var14) {
        }

        try {
            endTime = String.valueOf(map.get("staticsEndTime"));
            if (endTime != null && !"".equals(endTime) && !"null".equals(endTime)) {
                this.sql_where = this.sql_where + " and a01.a0180 <= to_date(" + endTime + ",'yyyy.MM')";
            }
        } catch (Exception var13) {
        }

        for(int i = 0; i < unitCode_list.length; ++i) {
            unitCode = unitCode + "'" + unitCode_list[i] + "',";
        }

        if (!unitCode_list[0].equals("")) {
            qureywhere = qureywhere + "  ";
            map.put("unitCodes", unitCode.substring(0, unitCode.length() - 1));
        }

        try {
            endTime = String.valueOf(map.get("staticsStartTime"));
            if (endTime != null && !"".equals(endTime) && !"null".equals(endTime)) {
                qureywhere = qureywhere + " and a01.a0180 >= to_date(" + endTime + ",'yyyy.MM')";
            }
        } catch (Exception var12) {
        }

        try {
            endTime = String.valueOf(map.get("staticsEndTime"));
            if (endTime != null && !"".equals(endTime) && !"null".equals(endTime)) {
                qureywhere = qureywhere + " and a01.a0180 <= to_date(" + endTime + ",'yyyy.MM')";
            }
        } catch (Exception var11) {
        }

        map.put("qureywhere", qureywhere);
        Page<A01> page = (new Query(map)).getPage();
        List<A01> list = this.statismenuMapper.intelligenceTSearch(page, map);
        return R.ok().put("page", new PageUtils(page.setRecords(list)));
    }

    static {
        map.put(1, "field operator to_date('value','yyyy.dd')");
        map.put(2, "TRUNC(months_between(sysdate, field)/12) operator 'value'");
        map.put(3, "field operator 'value'");
        map.put(4, "field operator '%value%'");
        aliasMap.put("40及以下", "0-40");
        aliasMap.put("41至45岁", "41-45");
        aliasMap.put("46至50岁", "46-50");
        aliasMap.put("51至55岁", "51-55");
        aliasMap.put("56至60岁", "56-60");
        aliasMap.put("61及以上", "61-120");
    }
}
